1. Field of the Invention
The present invention relates to a system for analyzing and debugging software through dynamic and interactive use of code markers, and more particularly, to a system and method of using code markers to analyze and debug complex host computer and embedded "black box" type software systems including microprocessor based real-time operating systems, even those with on-board caches and queues, so as to eliminate most dependencies on particular processors and language systems.
2. Description of the Prior Art
In recent years, software has had increasing importance in the computer industry. Software is used to control many increasingly complex processes, and the software itself has accordingly become increasingly complex. Many tools have been developed for assisting a software engineer in the development of such complex software. Such tools include compilers, assemblers, linkers, editors and the like, as well as other specification and design tools, configuration management tools, language smart editors and the like. Other tools, such as microprocessor emulators, also have been designed for operation on general purpose computers to assist software engineers in the development of software. Such products have led to the developing discipline of Computer Aided Software Engineering (CASE).
One of the primary tasks of the software engineer is to analyze his or her code to determine whether the code operates as desired so that if an error is found, a debugging process may be conducted. Traditional debugging methods include slow manual processes such as inserting print statements into the software at particular locations so that the values of variables and the like may be checked to determine if they have the expected values. However, such an approach is no longer desired because it results in very high overhead and intrusion on the operation of the code being examined. Moreover, such print statements are difficult to use in embedded software systems because the target processor on which the software is to run must have a port for the printed statements to be communicated to the output. As known to those skilled in the art, embedded systems are software/hardware systems dedicated to an application which requires consistent and timely control of, and response to, external events. Embedded systems may also involve presenting information about those events and allowing user interaction with the parameters controlling the application. It is thus desirable to develop a debugging system which can be used to debug software having application specific I/O.
Software and hardware debugging systems have also been designed to assist the software engineer in the debugging process. However, such debuggers are generally restricted to use with particular language systems and, as a result, are static and non-real-time. Moreover, such debuggers are generally not widely available for embedded environments because of the unpredictability of external events to which the system responds.
However, a certain class of conventional debuggers deals specifically with debugging real-time operating systems (RTOS). Normally, each RTOS has a compatible debugger that intimately knows the inner workings of that particular RTOS. As such, the debugger can display the current state of the RTOS resources such as the number of messages in each mailbox, which events are currently pending, or the current run status of each task at any point in time. Unfortunately, debuggers can only display a snapshot of the RTOS at a given point in time and are not able to display the flow of operating system activity in a real-time manner as it changes over time.
To fill this need for real-time tracing of RTOS activity, some users have attempted to use traditional emulation trace analyzers or logic analyzers to capture microprocessor bus cycle information and then relate it back to the RTOS activity. However, these attempts have failed for two reasons. First, commercially available RTOSs are normally viewed as "black boxes" whose inner workings are hidden from the end user. This makes correlating the captured data to RTOS activity impossible. Second, the amount of bus cycle level trace data captured is too great to allow any high level view of RTOS activity. A normal trace buffer can capture only enough bus cycle level data for one or two RTOS transactions, which does not provide the long term flow of RTOS activity desired. Conventional debuggers for RTOS thus have been of limited utility.
As just noted, logic analyzers have been used by software engineers to aid in debugging their code by providing low level views of microprocessor bus cycles and other logical blocks within the system. However, such logic analyzers require intimate knowledge of the microprocessor on which the software is operating in order to allow the user to view the data. Moreover, the data is generally not visible if the processor has an on board cache and is difficult to extract if the processor uses queuing or pipelining as in graphics systems, for example. Thus, logic analyzers are generally not geared for use by software engineers and, accordingly, are not particularly user friendly to software engineers.
Other debugger technology has been developed to appeal to the abstraction level of high level language software engineers. For example, a product called Validate/XEL.TM. has been provided to software engineers as an interface on top of an emulator which is designed to allow full speed emulation, modular architecture and high-speed downloads. However, such a system does not address the needs of large software design teams and cannot adequately handle rapidly increasing code sizes.
Another debugging tool which has been developed to assist software engineers is the Software Analysis Workbench (SAW). SAW hooks up to an IBM-Compatible PC-AT and ties to language tools in that environment. SAW can capture events in real-time and can monitor real-time execution without intrusion on the underlying software process. Unfortunately, SAW does not address the problems of caches and prefetched queues and does not eliminate most dependencies on particular processors and language systems.
An example of a tool for use with SAW is a system entitled TaskView.RTM., which uses the instrumented Verdix operating system written for the ADA language to write out data that an analyzer can capture and display later. In particular, TaskView.RTM. provides software engineers designing embedded systems using ADA the ability to analyze performance at the system state and task levels, to acquire a high-level trace of application tasks and kernel activities and to perform measurements with the instruction cache enabled. TaskView.RTM. purportedly creates a comprehensive run-time view of a multitasking embedded system from a single in-target measurement. TaskView.RTM. works in conjunction with SAW to create high-level trace files and tables of performance data for application tasks and various components of the multitasking run-time kernel. This allows the user to determine how the performance of an application program is related to that of an instrumented run-time kernel.
TaskView.RTM. operates on a special, instrumented version of the Verdix operating system which must be purchased from the operating system vendor. The Verdix operating system includes measurement information which is provided by the vendor by inserting memory write instructions, known as instrumentation points, at certain locations in the operating system code and then writing these instrumentation points to the same predefined memory locations so that SAW may acquire the instrumentation output by monitoring the microprocessor address and data buses. TaskView.RTM. thus uses SAW to track the execution of embedded software and then post-processes the acquired data to extract performance and trace information. As a result, timing measurements may be made even in systems with instruction prefetch and instruction caching. The instrumented code also enables dynamic run-time information to be gathered which includes the size and location of memory allocation, exception source location and discovered handler, task identification and system call type.
To use TaskView.RTM., the user must link his or her compiled application with the instrumented version of the run-time kernel. SAW must then be set up with a run-time event file for monitoring the instrumentation points. SAW then acquires the run-time data, and the file created by this measurement contains information on all entries to and exits from the kernel and the application tasks. TaskView.RTM. then takes this acquisition file and annotates it with symbolic information about the interrupt handlers and application tasks and produces a performance analysis and high-level trace views.
However, the use of TaskView.RTM. has been limited because it works only on Verdix ADA development systems, displays only certain parameters which are passed into the operating system kernel through a service call, and requires the user to buy a special, instrumented version of the Verdix operating system which has been preinstrumented by the vendor. A more flexible system is desired which enables the user to analyze and debug code as desired, even when the source code is unavailable and unknown to the user, for operating systems written in any computer language including assembly language. It is also desired to develop a system which may display any parameters desired by the user, including all parameters that are passed into the operating system kernel through a service call.
Accordingly, the prior art does not provide adequate general purpose means for analyzing and debugging complex host computer and embedded microprocessor based real-time operating systems and for cutting through the ambiguities of microprocessor prefetch and cache operations. Moreover, no prior art system is adequately designed to benefit software design teams developing large and complex embedded applications in any computer language which makes use of a multitasking operating system and/or object oriented systems with real-time requirements. The present invention has been designed to meet these needs.